<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>component-3</title>
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <script type="text/javascript" src="../assets/js/vue.js"></script>
</head>
<body>
    <h1>component-3</h1>
    <!-- 组件：自定义的html中不存在的标签 -->
    <hr>
    <div id="app">
        <panda></panda>
    </div>
    <script type="text/javascript">
          var city={
            template:`<div style="color:green">Sichuan of China</div>`
        }
        var pandaComponent={
            template:`
            <div>
           <p>Panda from China!</p>
           <city></city>
           </div>
            `,
            components:{//子组件city挂载到父组件panda里
                "city":city
            }
        }//定义变量，在外部声明局部组件
  
        var app=new Vue({
            el:'#app',
           components:{
               "panda":pandaComponent
           }
        }) 
    </script>
</body>
</html>